app.controller('landlordPassCtrl', function($element, $scope, $state, rest, user, uploadConf, $timeout, tipService, $window, $rootScope, decoJavaUrlLsf) {
    var data = angular.copy($scope.ngDialogData, {});
    var token = $window.localStorage.getItem("token");

    $scope.queryParams = {
        id: data.id,
        checkStatus: data.checkStatus,
        userId: data.userId,
    }

    $scope.makeSure = function() {

        if (!$scope.queryParams.rejectReason) {
            tipService.show("body", {
                message: "审核意见未填写",
                notice: "danger"
            }, 3);
            return;
        }

        rest.decoJava({
            type: "post",
            url: "/tenancy-sys/landlord/submitReview",
            data: $scope.queryParams,
            beforeSend: function(request) {
                request.setRequestHeader("token", token);
            },
            success: function(data) {
                if (data.code == 0000) {
                    tipService.show("body", {
                        message: data.message,
                    }, 3);
                    $scope.closeThisDialog();
                    $state.go('app.landlord.landlordManage');
                } else {
                    tipService.show("body", {
                        message: data.message,
                        notice: "danger"
                    }, 3);
                    return;
                }
            }
        });

    }

    $scope.hideBtn = function() {
        $scope.closeThisDialog();
    }

});